<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>修改单品</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../static/css/font.css" />
	<link rel="stylesheet" type="text/css" href="../static/css/weadmin.css" />
	<link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
	<style type="text/css">
		img {
			width: 150px;
			height: 200px;
			border: 1px solid silver;
		}
	</style>
</head>

<body>
	<div class="weadmin-body" id="app">
		<div class="layui-form">
			<div class="layui-row">
				<div class="layui-col-md12">
					<div class="layui-col-md4 layui-col-md-offset2" style="width: 175px;">
						<div class="layui-input-inline">
							<img :src="item.image">
						</div>
					</div>
					<div class="layui-col-md7">
						<div v-for="sp in speciList">
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='colour'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" :name="sp.specAliasName" class="layui-input"
										v-model="item.colour">
										<option :value="op.optionName" v-for="op in sp.options">{{op.optionName}}
										</option>
									</select>
								</div>
								<!-- <div class="layui-input-inline">
										<input class="layui-input" v-model="item.colour">
									</div> -->
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='network'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" :name="sp.specAliasName" class="layui-input"
										v-model="item.network">
										<option :value="op.optionName" v-for="op in sp.options">{{op.optionName}}
										</option>
									</select>
								</div>
								<!-- <div class="layui-input-inline">
										<input class="layui-input" v-model="item.network">
									</div> -->
							</div>
							<!-- <div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='yxnc' || sp.specAliasName=='jsnc'">
									<label class="layui-form-label">
										手机内存：
									</label>
									<div class="layui-input-inline">
										<input class="layui-input" v-model="item.runMemory">
									</div>
									<div class="layui-input-inline">
										<input class="layui-input" v-model="item.fuselageMemory">
									</div>
								</div> -->
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='yxnc'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" :name="sp.specAliasName" class="layui-input"
										v-model="item.runMemoryId">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item" style="margin: auto;" v-if="sp.specAliasName=='jsnc'">
								<label class="layui-form-label">
									{{sp.specName}}：
								</label>
								<div class="layui-input-inline">
									<select :id="sp.specAliasName" :name="sp.specAliasName" class="layui-input"
										v-model="item.fuselageMemoryId">
										<option :value="op.id" v-for="op in sp.options">{{op.optionName}}</option>
									</select>
								</div>
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								商品单价：
							</label>
							<div class="layui-input-inline">
								<input class="layui-input" v-model="item.price">
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<label class="layui-form-label">
								商品库存：
							</label>
							<div class="layui-input-inline">
								<input class="layui-input" v-model="item.num">
							</div>
						</div>
						<div class="layui-form-item" style="margin: auto;">
							<a title="修改" @click="updateItem">确认修改</a>
							<a title="返回"
								:href="'itemProductList.html?goodsId='+goodsId+'&defaultItemId='+defaultItemId">返回</a>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
	<script src="../lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../static/js/admin.js" type="text/javascript" charset="utf-8"></script>
	<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2"></script> -->
	<script src="../static/js/vue.js"></script>
	<script src="../static/js/axios.js"></script>
	<script src="../static/js/controller/CommonUrl_yh.js"></script>
	<script src="../static/js/controller/product_yh.js"></script>
	<script src="../static/js/service/product_yh.js"></script>
	<script type="text/javascript">
		axios.defaults.baseURL = axios_url.baseURL;
		var vueapp = new Vue({
			el: '#app',
			data: {
				item: null,			// 单品信息
				speciList: null,	// 规格列表
				goodId: null,		// 商品ID
				defaultItemId: null,// 默认绑定的单品ID，点击返回时需要带上
			},
			methods: {
				// 查询所有的商品信息
				findItemfromId: product_yh_controller.findItemfromId,
				// 修改单品信息
				updateItem: product_yh_controller.updateItem,
				// 规格回显查询
				findSpeciAll: product_yh_controller.findSpeciAll,
			},
			created: product_yh_service.createdDetails,
		})
	</script>
</body>

</html>